package com.dkm.ec.so.domain;

import javax.annotation.Resource;

import java_cup.runtime.virtual_parse_stack;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import com.dkm.biz.domain.AbstractDomain;
import com.dkm.base.core.helper.SpringHelper;
import com.dkm.ec.so.persistence.dao.ReturnLogDao;
import com.dkm.ec.so.persistence.entity.ReturnLogPo;
import com.dkm.ec.so.repository.ReturnLogRepository;

/**
 * 对象功能:退货操作日志 领域对象实体
 * 开发公司:dkm.com
 * 开发人员:ZHH
 * 创建时间:2017-06-20 18:59:29
 */
@SuppressWarnings("serial")
@Service
@Scope("prototype")
public class ReturnLog extends AbstractDomain<String, ReturnLogPo>{
	 
	 private ReturnLogDao returnLogDao = null;
     
	 @Resource
	 private ReturnLogRepository returnLogRepository;
	 
	protected void init(){
		returnLogDao = SpringHelper.getBean(ReturnLogDao.class);
		setDao(returnLogDao);
	}	 
	public void createPo(String partyId,String comment,String srcStatus,String returnId){
		ReturnLogPo returnLogPo = new ReturnLogPo();
		returnLogPo.setPartyId(partyId);
		returnLogPo.setComment(comment);
		returnLogPo.setSrcStatus(srcStatus);
		returnLogPo.setReturnId(returnId);
		
	  ReturnLog returnLog =	returnLogRepository.newInstance(returnLogPo);
	  returnLog.setNewFlag(true);
	  returnLog.create();
	}
}
